/****** Object:  Table [dbo].[Forum_GroupAccess]    Script Date: 11/03/2011 17:19:53 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [Forum_GroupAccess](
	[ForumID] [int] NOT NULL,
	[GroupID] [int] NOT NULL,
	[AccessType] [int] NOT NULL,
 CONSTRAINT [PK_Forum_GroupAccess] PRIMARY KEY CLUSTERED 
(
	[ForumID] ASC,
	[GroupID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [Forum_GroupAccess]  WITH CHECK ADD  CONSTRAINT [FK_Forum_GroupAccess_Forum_AccessTypes] FOREIGN KEY([AccessType])
REFERENCES [Forum_AccessTypes] ([AccessTypeID])
GO

ALTER TABLE [Forum_GroupAccess] CHECK CONSTRAINT [FK_Forum_GroupAccess_Forum_AccessTypes]
GO

ALTER TABLE [Forum_GroupAccess]  WITH CHECK ADD  CONSTRAINT [FK_Forum_GroupAccess_Forum_Config] FOREIGN KEY([ForumID])
REFERENCES [Forum_Config] ([forumid])
GO

ALTER TABLE [Forum_GroupAccess] CHECK CONSTRAINT [FK_Forum_GroupAccess_Forum_Config]
GO

ALTER TABLE [Forum_GroupAccess]  WITH CHECK ADD  CONSTRAINT [FK_Forum_GroupAccess_Forum_Groups] FOREIGN KEY([GroupID])
REFERENCES [Forum_Groups] ([levelid])
GO

ALTER TABLE [Forum_GroupAccess] CHECK CONSTRAINT [FK_Forum_GroupAccess_Forum_Groups]
GO

